from pathlib import Path
import sys
import os

CURRENT = Path(__file__).resolve().parent

# set config root to executable dir if using pyinstaller
if getattr(sys, 'frozen', False):
    # 如果由 PyInstaller 打包，则将配置根目录设置为可执行文件目录
    CONF_ROOT = Path(os.getcwd()).resolve()
else:
    # 在开发环境中运行
    CONF_ROOT = CURRENT.parent